<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>石油大学地质博物馆虚拟仿真模拟系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../static/css/public.min.css" />
    <link rel="stylesheet" href="../static/css/styles.min.css" />
    <script src="../static/js/jquery-3.4.0.min.js"></script>
</head>
<body>
    <div class="main-wrap">
        <div class="system-title-wrap">
            <div class="pic-wrap logo-wrap">
                <img src="../static/image/img/img_logo.png" alt="logo" class="pic-img logo-img" />
            </div>
            <!-- <div class="system-name">地质博物馆虚拟仿真系统</div> -->
        </div>
        <div class="system-content">
            <div class="content-item-wrap content-left-wrap">
                <div class="content-position-wrap" id="nav">
                </div>
                <div class="content-detail specimen-content" style="height:66vh">
                    <div class="specimen-detail-wrap">
                        <div class="specimen-profile-wrap">
                            <div class="specimen-profile-left pic-wrap specimen-img-wrap">
                                <img src="" alt="" class="pic-img specimen-img" id="img" />
                            </div>
                            <div class="specimen-profile-right specimen-profile-info">
                                <div class="detail-table-title-wrap">标本信息</div>
                                <ul class="clearfix list-wrap specimen-info-list-wrap specimen-profile-list-wrap">
                                    <li class="list-item specimen-info-item">
                                        <div class="profile-info-item">
                                            <div class="info-item-title">资源编号：</div>
                                            <div class="info-item-detail" id="resource_no"></div>
                                        </div>
                                        <div class="profile-info-item">
                                            <div class="info-item-title">资源名称：</div>
                                            <div class="info-item-detail" id="resource_name"></div>
                                        </div>
                                    </li>
                                    <li class="list-item specimen-info-item">
                                        <div class="profile-info-item">
                                            <div class="info-item-title">资源英文名：</div>
                                            <div class="info-item-detail" id="resource_foreign_name"></div>
                                        </div>
                                        <div class="profile-info-item">
                                            <div class="info-item-title">资源产地：</div>
                                            <div class="info-item-detail" id="place"></div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <div class="specimen-profile-right specimen-profile-info">
                            <div class="detail-table-title-wrap">详细信息</div>
                            <ul class="clearfix list-wrap specimen-info-list-wrap" id="details">
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="btn-wtap return-btn-wrap">
                    <div onclick="goBack()" class="btn-item return-btn-item">
                        <img src="../static/image/icon/icon_return.png" alt="" class="btn-icon" />
                        <span class="btn-item-title">返回上一级</span>
                    </div>
                </div>
            </div>
            <div class="content-item-wrap content-right-wrap">
                <div class="search-wrap">
                    <!-- <a href="search_index.html" class="search-item-a"> -->
                        <input type="search" name="search-input" id="search-input" class="search-input" placeholder="请输入搜索关键词" />
                        <!-- <span class="search-placeholder">请输入搜索关键词</span> -->
                        <img src="../static/image/icon/icon_search.png" alt="" class="search-icon" id="search-icon" />
                    <!-- </a> -->
                </div>
                <div class="btn-item-wrap">
                    <div onclick="goToWin('about_index')" class="btn-item-a">
                        <img src="../static/image/icon/icon_nav1_1.png" alt="" class="btn-icon" />
                        <!-- <p class="btn-title">博物馆介绍</p> -->
                    </div>
                </div>
                <div class="btn-item-wrap">
                    <div onclick="goToWin('article_list')" class="btn-item-a">
                        <img src="../static/image/icon/icon_nav2_1.png" alt="" class="btn-icon" />
                        <!-- <p class="btn-title">馆内动态文章</p> -->
                    </div>
                </div>
                <div class="btn-item-wrap">
                    <div onclick="goToWin('specimen_index')" class="btn-item-a">
                        <img src="../static/image/icon/icon_nav3_2.png" alt="" class="btn-icon" />
                        <!-- <p class="btn-title">标本</p> -->
                    </div>
                </div>
                <div class="btn-item-wrap">
                    <div onclick="goToIndex()" class="btn-item-a">
                        <img src="../static/image/icon/icon_nav4_1.png" alt="" class="btn-icon" />
                        <!-- <p class="btn-title">返回首页</p> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../static/js/shiyouda.js"></script>
<script type="text/javascript">
apiready = function(){
  var domain = localStorage.getItem('domain');
  console.log(api.pageParam.rockid);
  api.ajax({
      url: domain+'/api/rock/rockDetails.html',
      method: 'post',
      data:{
        values:{
          id:api.pageParam.rockid,
        }
      }
  },function(ret, err){
    console.log(ret.data.img);
    $('#resource_no').html(ret.data.resource_no);
    $('#resource_name').html(ret.data.resource_name);
    $('#resource_foreign_name').html(ret.data.resource_foreign_name);
    $('#place').html(ret.data.place);
    $('#img').attr('src', ret.data.img);
    str = '';
    // for (var i = 0; i < ret.data.list.length; i++) {
    //
    // }
    showNav(ret.data.cate, ret.data.cid, 0);
    str = ' <span class="position-item-icon"> > </span> <span class="position-item-title current">'+ret.data.resource_name+'</span>';
    $('#nav').append(str);
    getRockDetails(ret.data);
    $('#list').html(str);
  });
}
function getRockDetails(arr) {
  var paramArr = [
      {'name' : '用途',
      'key' : 'main_purpose'},

      {'name' : '形成时代',
      'key' : 'formation'},

      {'name' : '层位',
      'key' : 'position'},

      {'name' : '描述',
      'key' : 'describe'},

      {'name' : '具体用途',
      'key' : 'specific_purpose'},

      {'name' : '资源提供者',
      'key' : 'provider'},

      {'name' : '提供时间',
      'key' : 'provide_time'},

      {'name' : '经度',
      'key' : 'longitude'},

      {'name' : '维度',
      'key' : 'dimension'},

      {'name' : '高程',
      'key' : 'altitude'},

      {'name' : '链接',
      'key' : 'url'},

      {'name' : '保存单位',
      'key' : 'preservation'},

      {'name' : '保存编号',
      'key' : 'preservation_nom'},

      {'name' : '库存编号',
      'key' : 'specimen_no'},

      {'name' : '采集号',
      'key' : 'collection_no'},

      {'name' : '资源数量',
      'key' : 'resource_nom'},

      {'name' : '资源类型',
      'key' : 'resource_type'},

      {'name' : '共享方式',
      'key' : 'sharing'},

      {'name' : '资源状态',
      'key' : 'resource_state'},

      {'name' : '获取路径',
      'key' : 'obtain'},

      {'name' : '联系方式',
      'key' : 'contact'}
    ];

  var str = '';
  for(o in arr) {
    // console.log(o);
    var oData = arr[o];
    for(p in paramArr) {
      var pData = paramArr[p];
      if(o == pData['key']) {
        // console.log(o + ' - ' + pData['name'] + ' - ' + oData);
        if(oData != '') {
          str += '<li class="list-item specimen-info-item">';
          str += '<div class="profile-info-item">';
          str += '<div class="info-item-title">'+pData['name']+'：</div>';
          str += '<div class="info-item-detail info-item-detail-large">'+oData+'</div>';
          str += '</div>';
          str += '</li>';
        }
      }
    }
  }
  $('#details').html(str);
}
</script>
</html>
